<?php

session_start();

include_once "src/controller/blmanagement/ResourceManagement.php";
include_once "src/model/User.php";
include_once "src/misc/ClientReponseGenerator.php";

try {

    $resource = ResourceManagement::getResourceById($_POST["resourceId"]);

    $items = "";
    $items = "{\"name\":\"".$resource->getResourceName()."\", \"id\":\"".$resource->getResourceId()."\", \"description\":\"".$resource->getResourceDescription()."\", \"location\":\"".$resource->getResourceLocation()."\", \"group\":\"".$resource->getResourceGroup()."\", \"status\":\"".$resource->getResourceStatus()."\", \"owner\":\"".$resource->getOwnerId()."\"}";
    
    echo ClientReponseGenerator::jsonResponse(1, $items, "", "");

} catch (Exception $e) {
    echo ClientReponseGenerator::simpleJsonResponse(0, "GetResourceException", "");
}

?>
